<?php

namespace Crc\Entity;

use Doctrine\ORM\Mapping AS ORM,
    Doctrine\Common\Annotations\AnnotationRegistry,
    Doctrine\Common\Collections;

/**
 *
 *
 * @ORM\Entity(repositoryClass="Crc\Entity\Repository\WaterTypeRepository")
 * @ORM\Table(name="water_type")
 */

class WaterType
{

    /**
     * Default statuses
     */
    const STATUS_DELETED  = -1;
    const STATUS_INACTIVE =  0;
    const STATUS_ACTIVE   =  1;


    /**
     * @ORM\Id
     * @ORM\Column(type="integer")
     * @ORM\GeneratedValue
     * @var int
     */
    private $id;

    /**
     * @ORM\Column(type="string")
     */
    private $name;

    /**
     * @ORM\OneToMany(targetEntity="Puddle", mappedBy="waterType")
     */
    private $puddles;

    /**
     * @ORM\Column(name="sort_order", type="integer")
     */
    private $sortOrder;

    /**
     * @ORM\Column(type="integer")
     */
    private $status;

    public function __construct()
    {
        $this->puddles = new \Doctrine\Common\Collections\ArrayCollection();
    }

    public function setId($_id)
    {
        $this->id = $_id;
        return $this;
    }

    public function getId()
    {
        return $this->id;
    }

    public function setName($_name)
    {
        $this->name = $_name;
        return $this;
    }

    public function getName()
    {
        return $this->name;
    }

    public function addPuddle(Puddle $_pudle) {
         $this->puddles->add($_pudle);
         $_pudle->setWaterType($this);
         return $this;
    }

    public function getPuddles()
    {
        return $this->puddles;
    }

    public function setSortOrder($_sortOrder)
    {
        $this->sortOrder = $_sortOrder;
        return $this;
    }

    public function getSortOrder()
    {
        return $this->sortOrder;
    }

    public function setStatus($_status)
    {
        $this->status = $_status;
        return $this;
    }

    public function getStatus()
    {
        return $this->status;
    }

    public function __toString()
    {
        return $this->getName();
    }
}